<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h1>{{msg}}</h1>
        <!-- 建议 type='number' -->
        <input type="number"  v-model.number='age'>

        <input type="text" v-model.trim.number='age' >  


        <!-- .lazy   触发change 事件 失去焦点的时候  触发  不加就是触发input事件 -->
        <div>{{age}}</div>
    </div>
    <script src="./vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'vue',
                age:18
            },
            methods: {
            }
        });
    </script>
</body>

</html>